<?php

namespace App\Models;

use App\Models\Contract\SerializeDatetime;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Commission extends Model
{
    use HasFactory, SerializeDatetime;

    protected $fillable = [
        'user_id',
        'child_user_id',
        'child_user_withdraw_id',
        'child_user_money',
        'prize',
        'user_money',
        'exchange_rate',
        'amount',
        'child_user_withdraw_at',
        'by_groups',
        'source',
        'remark',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function child()
    {
        return $this->belongsTo(User::class, 'child_user_id');
    }
}
